// MIT License (MIT)
// 
// Copyright (c) 2014 K Ercan Turkarslan
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// 


using System;

namespace Mios.Generated.ServiceFiles
{
    // Generated from S_ZWaveDevice1.xml
    
    public class ZWaveDevice1Service : MiosService
    {
        #region PollSettings : UInt32;
        private UInt32? _mPollSettings;
        
        public UInt32 PollSettings
        {
            get
            {
                return _mPollSettings ?? GetPollSettings();
            }
        }
        
        #region Action GetPollSettings() : UInt32
        public UInt32 GetPollSettings()
        {
            _mPollSettings = FromLuupUInt32(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "PollSettings"));
            
            return _mPollSettings.Value;
        }
        #endregion Action Get
        #endregion
        
        #region PollCommands : String;
        private String _mPollCommands;
        
        public String PollCommands
        {
            get
            {
                return _mPollCommands ?? GetPollCommands();
            }
        }
        
        #region Action GetPollCommands() : String
        public String GetPollCommands()
        {
            _mPollCommands = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "PollCommands"));
            
            return _mPollCommands;
        }
        #endregion Action Get
        #endregion
        
        #region MultiChEndpoint : String;
        private String _mMultiChEndpoint;
        
        public String MultiChEndpoint
        {
            get
            {
                return _mMultiChEndpoint ?? GetMultiChEndpoint();
            }
        }
        
        #region Action GetMultiChEndpoint() : String
        public String GetMultiChEndpoint()
        {
            _mMultiChEndpoint = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "MultiChEndpoint"));
            
            return _mMultiChEndpoint;
        }
        #endregion Action Get
        #endregion
        
        #region MultiChCapabilities : String;
        private String _mMultiChCapabilities;
        
        public String MultiChCapabilities
        {
            get
            {
                return _mMultiChCapabilities ?? GetMultiChCapabilities();
            }
        }
        
        #region Action GetMultiChCapabilities() : String
        public String GetMultiChCapabilities()
        {
            _mMultiChCapabilities = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "MultiChCapabilities"));
            
            return _mMultiChCapabilities;
        }
        #endregion Action Get
        #endregion
        
        #region Neighbors : String;
        private String _mNeighbors;
        
        public String Neighbors
        {
            get
            {
                return _mNeighbors ?? GetNeighbors();
            }
        }
        
        #region Action GetNeighbors() : String
        public String GetNeighbors()
        {
            _mNeighbors = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "Neighbors"));
            
            return _mNeighbors;
        }
        #endregion Action Get
        #endregion
        
        #region NeighborsInverse : String;
        private String _mNeighborsInverse;
        
        public String NeighborsInverse
        {
            get
            {
                return _mNeighborsInverse ?? GetNeighborsInverse();
            }
        }
        
        #region Action GetNeighborsInverse() : String
        public String GetNeighborsInverse()
        {
            _mNeighborsInverse = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "NeighborsInverse"));
            
            return _mNeighborsInverse;
        }
        #endregion Action Get
        #endregion
        
        #region Capabilities : String;
        private String _mCapabilities;
        
        public String Capabilities
        {
            get
            {
                return _mCapabilities ?? GetCapabilities();
            }
        }
        
        #region Action GetCapabilities() : String
        public String GetCapabilities()
        {
            _mCapabilities = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "Capabilities"));
            
            return _mCapabilities;
        }
        #endregion Action Get
        #endregion
        
        #region SecurityFailed : Boolean;
        private Boolean? _mSecurityFailed;
        
        public Boolean SecurityFailed
        {
            get
            {
                return _mSecurityFailed ?? GetSecurityFailed();
            }
        }
        
        #region Action GetSecurityFailed() : Boolean
        public Boolean GetSecurityFailed()
        {
            _mSecurityFailed = FromLuupBoolean(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "SecurityFailed"));
            
            return _mSecurityFailed.Value;
        }
        #endregion Action Get
        #endregion
        
        #region LastReset : UInt32;
        private UInt32? _mLastReset;
        
        public UInt32 LastReset
        {
            get
            {
                return _mLastReset ?? GetLastReset();
            }
        }
        
        #region Action GetLastReset() : UInt32
        public UInt32 GetLastReset()
        {
            _mLastReset = FromLuupUInt32(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "LastReset"));
            
            return _mLastReset.Value;
        }
        #endregion Action Get
        #endregion
        
        #region WakeupInterval : UInt32;
        private UInt32? _mWakeupInterval;
        
        public UInt32 WakeupInterval
        {
            get
            {
                return _mWakeupInterval ?? GetWakeupInterval();
            }
        }
        
        #region Action GetWakeupInterval() : UInt32
        public UInt32 GetWakeupInterval()
        {
            _mWakeupInterval = FromLuupUInt32(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "WakeupInterval"));
            
            return _mWakeupInterval.Value;
        }
        #endregion Action Get
        #endregion
        
        #region LastWakeup : UInt32;
        private UInt32? _mLastWakeup;
        
        public UInt32 LastWakeup
        {
            get
            {
                return _mLastWakeup ?? GetLastWakeup();
            }
        }
        
        #region Action GetLastWakeup() : UInt32
        public UInt32 GetLastWakeup()
        {
            _mLastWakeup = FromLuupUInt32(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "LastWakeup"));
            
            return _mLastWakeup.Value;
        }
        #endregion Action Get
        #endregion
        
        #region LastRouteUpdate : UInt32;
        private UInt32? _mLastRouteUpdate;
        
        public UInt32 LastRouteUpdate
        {
            get
            {
                return _mLastRouteUpdate ?? GetLastRouteUpdate();
            }
        }
        
        #region Action GetLastRouteUpdate() : UInt32
        public UInt32 GetLastRouteUpdate()
        {
            _mLastRouteUpdate = FromLuupUInt32(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "LastRouteUpdate"));
            
            return _mLastRouteUpdate.Value;
        }
        #endregion Action Get
        #endregion
        
        #region Health : Byte;
        private Byte? _mHealth;
        
        public Byte Health
        {
            get
            {
                return _mHealth ?? GetHealth();
            }
        }
        
        #region Action GetHealth() : Byte
        public Byte GetHealth()
        {
            _mHealth = FromLuupByte(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "Health"));
            
            return _mHealth.Value;
        }
        #endregion Action Get
        #endregion
        
        #region HealthDate : UInt32;
        private UInt32? _mHealthDate;
        
        public UInt32 HealthDate
        {
            get
            {
                return _mHealthDate ?? GetHealthDate();
            }
        }
        
        #region Action GetHealthDate() : UInt32
        public UInt32 GetHealthDate()
        {
            _mHealthDate = FromLuupUInt32(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "HealthDate"));
            
            return _mHealthDate.Value;
        }
        #endregion Action Get
        #endregion
        
        #region VariablesGet : String;
        private String _mVariablesGet;
        
        public String VariablesGet
        {
            get
            {
                return _mVariablesGet ?? GetVariablesGet();
            }
        }
        
        #region Action GetVariablesGet() : String
        public String GetVariablesGet()
        {
            _mVariablesGet = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "VariablesGet"));
            
            return _mVariablesGet;
        }
        #endregion Action Get
        #endregion
        
        #region VariablesSet : String;
        private String _mVariablesSet;
        
        public String VariablesSet
        {
            get
            {
                return _mVariablesSet ?? GetVariablesSet();
            }
        }
        
        #region Action GetVariablesSet() : String
        public String GetVariablesSet()
        {
            _mVariablesSet = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "VariablesSet"));
            
            return _mVariablesSet;
        }
        #endregion Action Get
        #endregion
        
        #region AssociationGet : String;
        private String _mAssociationGet;
        
        public String AssociationGet
        {
            get
            {
                return _mAssociationGet ?? GetAssociationGet();
            }
        }
        
        #region Action GetAssociationGet() : String
        public String GetAssociationGet()
        {
            _mAssociationGet = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "AssociationGet"));
            
            return _mAssociationGet;
        }
        #endregion Action Get
        #endregion
        
        #region AssociationSet : String;
        private String _mAssociationSet;
        
        public String AssociationSet
        {
            get
            {
                return _mAssociationSet ?? GetAssociationSet();
            }
        }
        
        #region Action GetAssociationSet() : String
        public String GetAssociationSet()
        {
            _mAssociationSet = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "AssociationSet"));
            
            return _mAssociationSet;
        }
        #endregion Action Get
        #endregion
        
        #region AssociationNum : Byte;
        private Byte? _mAssociationNum;
        
        public Byte AssociationNum
        {
            get
            {
                return _mAssociationNum ?? GetAssociationNum();
            }
        }
        
        #region Action GetAssociationNum() : Byte
        public Byte GetAssociationNum()
        {
            _mAssociationNum = FromLuupByte(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "AssociationNum"));
            
            return _mAssociationNum.Value;
        }
        #endregion Action Get
        #endregion
        
        #region NonceACK : Boolean;
        private Boolean? _mNonceACK;
        
        public Boolean NonceACK
        {
            get
            {
                return _mNonceACK ?? GetNonceACK();
            }
        }
        
        #region Action GetNonceACK() : Boolean
        public Boolean GetNonceACK()
        {
            _mNonceACK = FromLuupBoolean(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "NonceACK"));
            
            return _mNonceACK.Value;
        }
        #endregion Action Get
        #endregion
        
        #region ManufacturerInfo : String;
        private String _mManufacturerInfo;
        
        public String ManufacturerInfo
        {
            get
            {
                return _mManufacturerInfo ?? GetManufacturerInfo();
            }
        }
        
        #region Action GetManufacturerInfo() : String
        public String GetManufacturerInfo()
        {
            _mManufacturerInfo = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "ManufacturerInfo"));
            
            return _mManufacturerInfo;
        }
        #endregion Action Get
        #endregion
        
        #region VersionInfo : String;
        private String _mVersionInfo;
        
        public String VersionInfo
        {
            get
            {
                return _mVersionInfo ?? GetVersionInfo();
            }
        }
        
        #region Action GetVersionInfo() : String
        public String GetVersionInfo()
        {
            _mVersionInfo = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "VersionInfo"));
            
            return _mVersionInfo;
        }
        #endregion Action Get
        #endregion
        
        #region SetPointInfo : String;
        private String _mSetPointInfo;
        
        public String SetPointInfo
        {
            get
            {
                return _mSetPointInfo ?? GetSetPointInfo();
            }
        }
        
        #region Action GetSetPointInfo() : String
        public String GetSetPointInfo()
        {
            _mSetPointInfo = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "SetPointInfo"));
            
            return _mSetPointInfo;
        }
        #endregion Action Get
        #endregion
        
        #region NodeInfo : String;
        private String _mNodeInfo;
        
        public String NodeInfo
        {
            get
            {
                return _mNodeInfo ?? GetNodeInfo();
            }
        }
        
        #region Action GetNodeInfo() : String
        public String GetNodeInfo()
        {
            _mNodeInfo = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "NodeInfo"));
            
            return _mNodeInfo;
        }
        #endregion Action Get
        #endregion
        
        #region InitialName : String;
        private String _mInitialName;
        
        public String InitialName
        {
            get
            {
                return _mInitialName ?? GetInitialName();
            }
        }
        
        #region Action GetInitialName() : String
        public String GetInitialName()
        {
            _mInitialName = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "InitialName"));
            
            return _mInitialName;
        }
        #endregion Action Get
        #endregion
        
        #region ConfiguredName : String;
        private String _mConfiguredName;
        
        public String ConfiguredName
        {
            get
            {
                return _mConfiguredName ?? GetConfiguredName();
            }
        }
        
        #region Action GetConfiguredName() : String
        public String GetConfiguredName()
        {
            _mConfiguredName = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "ConfiguredName"));
            
            return _mConfiguredName;
        }
        #endregion Action Get
        #endregion
        
        #region ConfiguredVariable : String;
        private String _mConfiguredVariable;
        
        public String ConfiguredVariable
        {
            get
            {
                return _mConfiguredVariable ?? GetConfiguredVariable();
            }
        }
        
        #region Action GetConfiguredVariable() : String
        public String GetConfiguredVariable()
        {
            _mConfiguredVariable = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "ConfiguredVariable"));
            
            return _mConfiguredVariable;
        }
        #endregion Action Get
        #endregion
        
        #region ConfiguredAssoc : String;
        private String _mConfiguredAssoc;
        
        public String ConfiguredAssoc
        {
            get
            {
                return _mConfiguredAssoc ?? GetConfiguredAssoc();
            }
        }
        
        #region Action GetConfiguredAssoc() : String
        public String GetConfiguredAssoc()
        {
            _mConfiguredAssoc = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "ConfiguredAssoc"));
            
            return _mConfiguredAssoc;
        }
        #endregion Action Get
        #endregion
        
        #region Documentation : String;
        private String _mDocumentation;
        
        public String Documentation
        {
            get
            {
                return _mDocumentation ?? GetDocumentation();
            }
        }
        
        #region Action GetDocumentation() : String
        public String GetDocumentation()
        {
            _mDocumentation = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "Documentation"));
            
            return _mDocumentation;
        }
        #endregion Action Get
        #endregion
        
        #region MeterType : Byte;
        private Byte? _mMeterType;
        
        public Byte MeterType
        {
            get
            {
                return _mMeterType ?? GetMeterType();
            }
        }
        
        #region Action GetMeterType() : Byte
        public Byte GetMeterType()
        {
            _mMeterType = FromLuupByte(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "MeterType"));
            
            return _mMeterType.Value;
        }
        #endregion Action Get
        #endregion
        
        #region MeterScale : UInt32;
        private UInt32? _mMeterScale;
        
        public UInt32 MeterScale
        {
            get
            {
                return _mMeterScale ?? GetMeterScale();
            }
        }
        
        #region Action GetMeterScale() : UInt32
        public UInt32 GetMeterScale()
        {
            _mMeterScale = FromLuupUInt32(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "MeterScale"));
            
            return _mMeterScale.Value;
        }
        #endregion Action Get
        #endregion
        
        #region AlarmType : String;
        private String _mAlarmType;
        
        public String AlarmType
        {
            get
            {
                return _mAlarmType ?? GetAlarmType();
            }
        }
        
        #region Action GetAlarmType() : String
        public String GetAlarmType()
        {
            _mAlarmType = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "AlarmType"));
            
            return _mAlarmType;
        }
        #endregion Action Get
        #endregion
        
        #region PollOk : UInt32;
        private UInt32? _mPollOk;
        
        public UInt32 PollOk
        {
            get
            {
                return _mPollOk ?? GetPollOk();
            }
        }
        
        #region Action GetPollOk() : UInt32
        public UInt32 GetPollOk()
        {
            _mPollOk = FromLuupUInt32(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "PollOk"));
            
            return _mPollOk.Value;
        }
        #endregion Action Get
        #endregion
        
        #region PollTxFail : UInt32;
        private UInt32? _mPollTxFail;
        
        public UInt32 PollTxFail
        {
            get
            {
                return _mPollTxFail ?? GetPollTxFail();
            }
        }
        
        #region Action GetPollTxFail() : UInt32
        public UInt32 GetPollTxFail()
        {
            _mPollTxFail = FromLuupUInt32(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "PollTxFail"));
            
            return _mPollTxFail.Value;
        }
        #endregion Action Get
        #endregion
        
        #region PollNoReply : UInt32;
        private UInt32? _mPollNoReply;
        
        public UInt32 PollNoReply
        {
            get
            {
                return _mPollNoReply ?? GetPollNoReply();
            }
        }
        
        #region Action GetPollNoReply() : UInt32
        public UInt32 GetPollNoReply()
        {
            _mPollNoReply = FromLuupUInt32(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "PollNoReply"));
            
            return _mPollNoReply.Value;
        }
        #endregion Action Get
        #endregion
        
        #region ManualRoute : String;
        private String _mManualRoute;
        
        public String ManualRoute
        {
            get
            {
                return _mManualRoute ?? GetManualRoute();
            }
        }
        
        #region Action GetManualRoute() : String
        public String GetManualRoute()
        {
            _mManualRoute = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "ManualRoute"));
            
            return _mManualRoute;
        }
        #endregion Action Get
        #endregion
        
        #region AllRoutesFailed : Boolean;
        private Boolean? _mAllRoutesFailed;
        
        public Boolean AllRoutesFailed
        {
            get
            {
                return _mAllRoutesFailed ?? GetAllRoutesFailed();
            }
        }
        
        #region Action GetAllRoutesFailed() : Boolean
        public Boolean GetAllRoutesFailed()
        {
            _mAllRoutesFailed = FromLuupBoolean(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "AllRoutesFailed"));
            
            return _mAllRoutesFailed.Value;
        }
        #endregion Action Get
        #endregion
        
        #region AutoRoute : String;
        private String _mAutoRoute;
        
        public String AutoRoute
        {
            get
            {
                return _mAutoRoute ?? GetAutoRoute();
            }
        }
        
        #region Action GetAutoRoute() : String
        public String GetAutoRoute()
        {
            _mAutoRoute = FromLuupString(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "AutoRoute"));
            
            return _mAutoRoute;
        }
        #endregion Action Get
        #endregion
        
        
        #region SetVariable method
        internal override Boolean SetVariable(String name, String value)
        {
            switch(name)
            {
                case "AlarmType": _mAlarmType = FromLuupString(value); return true;
                case "AllRoutesFailed": _mAllRoutesFailed = FromLuupBoolean(value); return true;
                case "AssociationGet": _mAssociationGet = FromLuupString(value); return true;
                case "AssociationNum": _mAssociationNum = FromLuupByte(value); return true;
                case "AssociationSet": _mAssociationSet = FromLuupString(value); return true;
                case "AutoRoute": _mAutoRoute = FromLuupString(value); return true;
                case "Capabilities": _mCapabilities = FromLuupString(value); return true;
                case "ConfiguredAssoc": _mConfiguredAssoc = FromLuupString(value); return true;
                case "ConfiguredName": _mConfiguredName = FromLuupString(value); return true;
                case "ConfiguredVariable": _mConfiguredVariable = FromLuupString(value); return true;
                case "Documentation": _mDocumentation = FromLuupString(value); return true;
                case "Health": _mHealth = FromLuupByte(value); return true;
                case "HealthDate": _mHealthDate = FromLuupUInt32(value); return true;
                case "InitialName": _mInitialName = FromLuupString(value); return true;
                case "LastReset": _mLastReset = FromLuupUInt32(value); return true;
                case "LastRouteUpdate": _mLastRouteUpdate = FromLuupUInt32(value); return true;
                case "LastWakeup": _mLastWakeup = FromLuupUInt32(value); return true;
                case "ManualRoute": _mManualRoute = FromLuupString(value); return true;
                case "ManufacturerInfo": _mManufacturerInfo = FromLuupString(value); return true;
                case "MeterScale": _mMeterScale = FromLuupUInt32(value); return true;
                case "MeterType": _mMeterType = FromLuupByte(value); return true;
                case "MultiChCapabilities": _mMultiChCapabilities = FromLuupString(value); return true;
                case "MultiChEndpoint": _mMultiChEndpoint = FromLuupString(value); return true;
                case "Neighbors": _mNeighbors = FromLuupString(value); return true;
                case "NeighborsInverse": _mNeighborsInverse = FromLuupString(value); return true;
                case "NodeInfo": _mNodeInfo = FromLuupString(value); return true;
                case "NonceACK": _mNonceACK = FromLuupBoolean(value); return true;
                case "PollCommands": _mPollCommands = FromLuupString(value); return true;
                case "PollNoReply": _mPollNoReply = FromLuupUInt32(value); return true;
                case "PollOk": _mPollOk = FromLuupUInt32(value); return true;
                case "PollSettings": _mPollSettings = FromLuupUInt32(value); return true;
                case "PollTxFail": _mPollTxFail = FromLuupUInt32(value); return true;
                case "SecurityFailed": _mSecurityFailed = FromLuupBoolean(value); return true;
                case "SetPointInfo": _mSetPointInfo = FromLuupString(value); return true;
                case "VariablesGet": _mVariablesGet = FromLuupString(value); return true;
                case "VariablesSet": _mVariablesSet = FromLuupString(value); return true;
                case "VersionInfo": _mVersionInfo = FromLuupString(value); return true;
                case "WakeupInterval": _mWakeupInterval = FromLuupUInt32(value); return true;
                default:
                    return false;
            }
        }
        #endregion SetVariable method
        
        public ZWaveDevice1Service(MiosEngine engine, UInt32 deviceId, String serviceId)
            : base(engine, deviceId, serviceId)
        {
            
        } //Constructor
    } //Class
} //Namespace

